import request from '@/utils/request'
const contract = {
  queryContractListAPI: function (params) {
    return request({
      url: '/eims/contract/list',
      method: 'post',
      data: params
    })
  },
  getContractInfoAPI: function (contractCode) {
    return request({
      url: '/eims/contract/info/' + contractCode,
      method: 'get'
    })
  },
  submitContractInfoAPI: function (param) {
    return request({
      url: '/eims/contract/submit/' + param.contractCode,
      method: 'put',
      data: param
    })
  },
  cancelContractInfoAPI: function (param) {
    return request({
      url: '/eims/contract/cancel/' + param.contractCode,
      method: 'put',
      data: param
    })
  },
  rejectContractInfoAPI: function (param) {
    return request({
      url: '/eims/contract/reject/' + param.contractCode,
      method: 'put',
      data: param
    })
  },
  passContractInfoAPI: function (param) {
    return request({
      url: '/eims/contract/pass/' + param.contractCode,
      method: 'put',
      data: param
    })
  },
  getContractTemplateListAPI: function (params) {
    return request({
      url: '/eims/contract/template/list',
      method: 'post',
      data: params
    })
  },
  getContractTemplateFieldAPI: function (contractTemplate) {
    return request({
      url: '/eims/contract/template/field/' + contractTemplate,
      method: 'get'
    })
  },
  getContractAttachmentListAPI: function (contractCode) {
    return request({
      url: '/eims/contract/attachment/list/' + contractCode,
      method: 'get'
    })
  },
  getContractFileListAPI: function (contractCode) {
    return request({
      url: '/eims/contract/file/list/' + contractCode,
      method: 'get'
    })
  },
  getContractFileListPageAPI: function (params) {
    return request({
      url: '/eims/contract/file/list',
      method: 'post',
      data: params
    })
  },
  downloadContractFileAPI: function (contractFileCode) {
    return request({
      url: '/eims/contract/file/download/' + contractFileCode,
      method: 'get'
    })
  },
  generateContractFileAPI: function (contractFileCode) {
    return request({
      url: '/eims/contract/file/generate/' + contractFileCode,
      method: 'get'
    })
  },
  saveContractAPI: function (params) {
    return request({
      url: '/eims/contract/save',
      method: 'post',
      data: params
    })
  },
  updateContractAPI: function (params) {
    return request({
      url: '/eims/contract/update/' + params.contractCode,
      method: 'put',
      data: params
    })
  },
  saveContractFileAPI: function (params) {
    return request({
      url: '/eims/contract/file/save',
      method: 'post',
      data: params
    })
  },
  updateContractFileAPI: function (params) {
    return request({
      url: '/eims/contract/file/update/' + params.contractFileCode,
      method: 'put',
      data: params
    })
  },
  deleteContractFileAPI: function (contractFileCode) {
    return request({
      url: '/eims/contract/file/delete/' + contractFileCode,
      method: 'delete'
    })
  },
  saveContractAttachmentAPI: function (params) {
    return request({
      url: '/eims/contract/attachment/save',
      method: 'post',
      data: params
    })
  },
  deleteContractAttachmentAPI: function (attachmentCode) {
    return request({
      url: '/eims/contract/attachment/delete/' + attachmentCode,
      method: 'delete'
    })
  },
  saveContractSignerAPI: function (params) {
    return request({
      url: '/eims/contract/file/signer/save',
      method: 'post',
      data: params
    })
  },
  deleteContractSignerAPI: function (params) {
    return request({
      url: '/eims/contract/file/signer/delete/' + params.contractFileCode + '/' + params.signerCode,
      method: 'delete'
    })
  },
  getContractFileSignerListAPI: function (contractFileCode) {
    return request({
      url: '/eims/contract/file/signer/list/' + contractFileCode,
      method: 'get'
    })
  },
  initiateConfirmContractFileAPI: function (params) {
    return request({
      url: '/eims/contract/initiate/confirm',
      method: 'post',
      data: params
    })
  },
  signingConfirmContractAPI: function (params) {
    return request({
      url: '/eims/contract/signing/confirm',
      method: 'post',
      data: params
    })
  }
}
export default contract
